//
//  AboutGruphotoViewController.m
//  Gruphoto
//
//  Created by Thao Nguyen Huy on 1/18/13.
//  Copyright (c) 2013 CNC Software. All rights reserved.
//

#import "AboutGruphotoViewController.h"
#import <QuartzCore/QuartzCore.h>

@interface AboutGruphotoViewController ()

@end

@implementation AboutGruphotoViewController
@synthesize aboutTextView;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
		UIImageView *titleImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"title_about.png"]];
		self.navigationItem.titleView = titleImageView;
		[titleImageView release];
        
        UIButton *doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [doneButton setBounds:CGRectMake(0, 0, 51, 30)];
        [doneButton setBackgroundImage:[UIImage imageNamed:@"button_done.png"] forState:UIControlStateNormal];
        [doneButton addTarget:self action:@selector(doneButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
        UIBarButtonItem *doneButtonItem = [[UIBarButtonItem alloc] initWithCustomView:doneButton];
        self.navigationItem.rightBarButtonItem = doneButtonItem;
        [doneButtonItem release];
        
        self.navigationItem.hidesBackButton = YES;
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor colorWithRed:226/255.0 green:231/255.0 blue:237/255.0 alpha:1.0];
    aboutTextView.layer.borderWidth = 1;
    aboutTextView.layer.borderColor = [UIColor colorWithRed:171/255.0 green:171/255.0 blue:171/255.0 alpha:1.0].CGColor;
    aboutTextView.layer.cornerRadius = 10;
    aboutTextView.layer.masksToBounds = YES;
    NSLog(@"textview: %@", aboutTextView);
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    self.aboutTextView = nil;
}

- (void)dealloc {
    [aboutTextView release];
    [super dealloc];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Action methods
- (IBAction)doneButtonPressed:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

@end
